local sk__huilian = fk.CreateSkill {

  name = "sk__huilian",

  tags = {  },

}



sk__huilian:addEffect("active", {
  name = "sk__huilian",
  anim_type = "support",
  prompt = "#sk__huilian",
  card_num = 0,
  target_num = 1,
  can_use = function(self, player)
    return player:usedSkillTimes(sk__huilian.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter =function (self, player, to_select, selected, selected_cards)
    return #selected == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local judge = {
      who = target,
      reason = sk__huilian.name,
      pattern = ".",
      skipDrop = true,
    }
    room:judge(judge)
    if room:getCardArea(judge.card) == Card.Processing then
      if not target.dead then
        room:moveCardTo(judge.card, Card.PlayerHand, target, fk.ReasonJustMove, sk__huilian.name, nil, true, target)
      else
        room:moveCardTo(judge.card, Card.DiscardPile, nil, fk.ReasonJustMove, sk__huilian.name, nil, true)
      end
    end
    if judge.card.suit == Card.Heart and not target.dead and target:isWounded() then
      room:recover({
        who = target,
        num = 1,
        recoverBy = player,
        skillName = sk__huilian.name,
      })
    end
  end,
})

return sk__huilian